/*
 * File:   IEngine.h
 * Author: Elevator
 *
 * Created on 24 Май 2013 г., 22:42
 */

#ifndef PHYSICS_IENGINE_H
#define PHYSICS_IENGINE_H

#include "Joints/IJoint.h"
#include "Joints/IHingeJoint.h"
#include "Joints/IDistanceJoint.h"
#include "Joints/IParallelJoint.h"
#include "Bodies/IBody.h"
#include "Shapes/IShape.h"
#include "Shapes/ICircleShape.h"
#include "Shapes/IPolygonShape.h"

namespace physics {

	class IEngine {
	public:

		virtual ~IEngine( ) {
		}

		virtual IHingeJoint* CreateHingeJoint(
			IBody* bodyA, IBody* bodyB,
			const Vec2& anchor,
			bool collide,
			bool enableLimit, float leftLimit, float rightLimit,
			bool enableMotor, float motorForce, float motorSpeed ) = 0;

		virtual void DestroyHingeJoint( IHingeJoint* joint ) = 0;

		virtual IDistanceJoint* CreateDistanceJoint(
			IBody* bodyA, IBody* bodyB,
			const Vec2& anchorA, const Vec2& anchorB,
			bool collide,
			float length, float frequency,
			float dampingRatio ) = 0;

		virtual void DestroyDistanceJoint( IDistanceJoint* joint ) = 0;

		virtual IParallelJoint* CreateParallelJoint(
			IBody* bodyA, IBody* bodyB,
			const Vec2& anchor, const Vec2& axis,
			bool collide,
			bool enableLimit, float lowerLimit, float upperLimit,
			bool enableMotor, float motorForce, float motorSpeed ) = 0;

		virtual void DestroyParallelJoint( IParallelJoint* joint ) = 0;

		virtual IBody* CreateBody( IBody::Type type,
			const Transform& position,
			const Transform& velosity,
			float mass, float inertia ) = 0;

		virtual void DestroyBody( IBody* body ) = 0;

		virtual ICircleShape* CreateCircleShape( Vec2 pos, float radius ) = 0;
		virtual IPolygonShape* CreatePolygonShape( Transform pos ) = 0;

		virtual void Update( float dt ) = 0;
	};
}
#endif	/* IENGINE_H */
